<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): OCILIB main C++ demo application code</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_cpp_api_main_demo_application.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">OCILIB main C++ demo application code<div class="ingroups"><a class="el" href="group___ocilib_cpp_api.html">C++ API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<p>Main C++ demo source </p><div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"> * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Website: http://www.ocilib.net</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Copyright (c) 2007-2016 Vincent ROGIER &lt;vince.rogier@ocilib.net&gt;</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><span class="comment"> * limitations under the License.</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#include &quot;ocilib.hpp&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#ifdef _MSC_VER</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"><span class="preprocessor">#pragma comment(lib, &quot;ocilibw.lib&quot;)</span></div>
<div class="line"><span class="preprocessor">#elif defined(OCI_CHARSET_ANSI)</span></div>
<div class="line"><span class="preprocessor">#pragma comment(lib, &quot;ociliba.lib&quot;)</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceocilib.html">ocilib</a>;</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;fstream&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;iomanip&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* CONSTANTS</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> ArgDatabase = 1;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> ArgUser = 2;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> ArgPassword = 3;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> ArgHome = 4;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> ArgCount = 5;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> SizeString = 260;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> SizeBuffer = 2048;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> ElemCount = 5;</div>
<div class="line"></div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> DirPathBufferSize = 64000;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> DirPathLoadSize = 100;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> DirPathLoadCount = 10;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> DirPathSizeColumn1 = 20;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> DirPathSizeColumn2 = 30;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> DirPathSizeColumn3 = 8;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> DirPathColumnCount = 3;</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* DEFINES</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#ifndef OCI_SHARED_LIB</span></div>
<div class="line"><span class="preprocessor">#if defined(_WINDOWS)</span></div>
<div class="line"><span class="preprocessor">#if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"><span class="preprocessor">#define OCI_SHARED_LIB                   &quot;ocilibw.dll&quot;</span></div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"><span class="preprocessor">#define OCI_SHARED_LIB                   &quot;ociliba.dll&quot;</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor">#elif defined(__APPLE__)</span></div>
<div class="line"><span class="preprocessor">#define OCI_SHARED_LIB                   &quot;libocilib.dylib&quot;</span></div>
<div class="line"><span class="preprocessor">#elif defined(__hppa)</span></div>
<div class="line"><span class="preprocessor">#define OCI_SHARED_LIB                   &quot;libocilib.sl&quot;</span></div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"><span class="preprocessor">#define OCI_SHARED_LIB                   &quot;libocilib.so&quot;</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define otext(s) OTEXT(s)</span></div>
<div class="line"><span class="preprocessor">#define oendl  std::endl</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"><span class="preprocessor">#if defined(_MSC_VER)</span></div>
<div class="line"><span class="preprocessor">#define omain           wmain</span></div>
<div class="line"><span class="preprocessor">#define oarg            otext</span></div>
<div class="line"><span class="preprocessor">#define oarglen         wcslen</span></div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"><span class="preprocessor">#define omain           main</span></div>
<div class="line"><span class="preprocessor">#define oarg            char</span></div>
<div class="line"><span class="preprocessor">#define oarglen         strlen</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"><span class="preprocessor">#define omain             main</span></div>
<div class="line"><span class="preprocessor">#define oarg              char</span></div>
<div class="line"><span class="preprocessor">#define oarglen           strlen</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"><span class="preprocessor">#define ocout             std::wcout</span></div>
<div class="line"><span class="preprocessor">#define oostringstream    std::wostringstream</span></div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"><span class="preprocessor">#define ocout             std::cout</span></div>
<div class="line"><span class="preprocessor">#define oostringstream    std::ostringstream</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define ARRAY_COUNT(t) (sizeof(t)/sizeof(t[0]))</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* LOCAL TYPES for the demo</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">struct </span>Test</div>
<div class="line">{</div>
<div class="line">    void(*proc)(void); <span class="comment">/* test procedure */</span></div>
<div class="line">    <span class="keywordtype">int</span>    execute;     <span class="comment">/* do execute the procedure ? */</span></div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">// User translation of the test_table SQL tables rows</span></div>
<div class="line"><span class="keyword">struct </span>Product</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> code;</div>
<div class="line">    <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> action;</div>
<div class="line">    <span class="keywordtype">double</span> price;</div>
<div class="line">    <a class="code" href="classocilib_1_1_date.html">Date</a> date;</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">// User translation of the test_array SQL table rows</span></div>
<div class="line"><span class="keyword">struct </span>TestArray</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> val_int;</div>
<div class="line">    <span class="keywordtype">float</span> val_flt;</div>
<div class="line">    <span class="keywordtype">double</span> val_dbl;</div>
<div class="line">    <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> val_str;</div>
<div class="line">    <a class="code" href="classocilib_1_1_date.html">Date</a> val_date;</div>
<div class="line">    <a class="code" href="classocilib_1_1_lob.html">Clob</a> val_lob;</div>
<div class="line">    <a class="code" href="classocilib_1_1_file.html">File</a> val_file;</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* prototypes</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> print_version(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> create_tables(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> drop_tables(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> execute_ddl(<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> sql);</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_format(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_immediate(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_immediate_format(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_fetch(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_fetch_translate(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_foreach(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_foreach_translate(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_bind1(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_bind2(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_piecewise_insert(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_piecewise_fetch(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_lob(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_nested_table(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_ref_cursor(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_plsql(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_dates(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_timestamp(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_describe(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_returning(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_returning_array(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_object_insert(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_object_fetch(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_scrollable_cursor(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_collection(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_ref(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_directpath(<span class="keywordtype">void</span>);</div>
<div class="line"></div>
<div class="line">Product CreateProductFromQuery(<span class="keyword">const</span> <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> &amp;rs);</div>
<div class="line"><span class="keywordtype">bool</span> FillProductFromQuery(<span class="keyword">const</span> <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> &amp;rs, Product &amp;p);</div>
<div class="line"><span class="keywordtype">bool</span> PrintProductFromQuery(<span class="keyword">const</span> <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> &amp;rs);</div>
<div class="line"><span class="keywordtype">bool</span> PrintProductFromObject(<span class="keyword">const</span> Product &amp;p);</div>
<div class="line"></div>
<div class="line"><span class="comment">/* ocilib test functions array */</span></div>
<div class="line"></div>
<div class="line">Test tab_test[] =</div>
<div class="line">{</div>
<div class="line">    { test_fetch, TRUE },</div>
<div class="line">    { test_fetch_translate, TRUE },</div>
<div class="line">    { test_foreach, TRUE },</div>
<div class="line">    { test_foreach_translate, TRUE },</div>
<div class="line">    { test_bind1, TRUE },</div>
<div class="line">    { test_bind2, TRUE },</div>
<div class="line">    { test_piecewise_insert, TRUE },</div>
<div class="line">    { test_piecewise_fetch, TRUE },</div>
<div class="line">    { test_lob, TRUE },</div>
<div class="line">    { test_nested_table, TRUE },</div>
<div class="line">    { test_ref_cursor, TRUE },</div>
<div class="line">    { test_plsql, TRUE },</div>
<div class="line">    { test_dates, TRUE },</div>
<div class="line">    { test_timestamp, TRUE },</div>
<div class="line">    { test_describe, TRUE },</div>
<div class="line">    { test_returning, TRUE },</div>
<div class="line">    { test_returning_array, TRUE },</div>
<div class="line">    { test_object_insert, TRUE },</div>
<div class="line">    { test_object_fetch, TRUE },</div>
<div class="line">    { test_scrollable_cursor, TRUE },</div>
<div class="line">    { test_collection, TRUE },</div>
<div class="line">    { test_ref, TRUE },</div>
<div class="line">    { test_directpath, TRUE }</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* variables</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> <a class="code" href="classocilib_1_1_connection.html">Connection</a> con;</div>
<div class="line"></div>
<div class="line"><span class="keyword">inline</span> <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> GetArg(oarg *arg)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> res;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (arg)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordtype">size_t</span> i = 0, size = oarglen(arg);</div>
<div class="line"></div>
<div class="line">        res.resize(size);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">while</span> (i &lt; size) { res[i] = <span class="keyword">static_cast&lt;</span><span class="keywordtype">char</span><span class="keyword">&gt;</span>(arg[i]); i++; }</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span> res;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* main</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> omain(<span class="keywordtype">int</span> argc, oarg* argv[])</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> home;</div>
<div class="line">    <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> dbs;</div>
<div class="line">    <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> usr;</div>
<div class="line">    <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> pwd;</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">size_t</span> i;</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* CHECK COMMAND LINE --------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (argc &lt; (ArgCount - 1))</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* GET ARGUMENTS ---------------------------------------------------------*/</span></div>
<div class="line"></div>
<div class="line">    dbs = GetArg(argv[ArgDatabase]);</div>
<div class="line">    usr = GetArg(argv[ArgUser]);</div>
<div class="line">    pwd = GetArg(argv[ArgPassword]);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (argc == ArgCount)</div>
<div class="line">    {</div>
<div class="line">        home = GetArg(argv[ArgHome]);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">try</span></div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_environment.html#a83613d62908717ddf7d0ac797d63120a">Environment::Initialize</a>(<a class="code" href="classocilib_1_1_environment.html#a87b82fd52f230a521416ee49e2ace788a8f941bda8402802bb9c30d49ca6318f7">Environment::Default</a> | Environment::Threaded, home);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_environment.html#a5d339bf030bab748a439a830ccb777b5">Environment::EnableWarnings</a>(<span class="keyword">true</span>);</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;Connecting to &quot;</span>) &lt;&lt; usr &lt;&lt; otext(<span class="stringliteral">&quot;/&quot;</span>) &lt;&lt; pwd &lt;&lt; otext(<span class="stringliteral">&quot;@&quot;</span>) &lt;&lt; dbs &lt;&lt; oendl &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        con.<a class="code" href="classocilib_1_1_connection.html#a7cb9e2d4c98a3753325f88504c311be3">Open</a>(dbs, usr, pwd, <a class="code" href="classocilib_1_1_environment.html#ac583b9f6d4fd1da0282afe6e8fb774aeaafa2fca26ddd12a45b9f5e2972f41c27">Environment::SessionDefault</a>);</div>
<div class="line"></div>
<div class="line">        print_version();</div>
<div class="line">        create_tables();</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* execute tests */</span></div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">for</span> (i = 0; i &lt; ARRAY_COUNT(tab_test); i++)</div>
<div class="line">        {</div>
<div class="line">            <span class="keywordflow">if</span> (tab_test[i].execute)</div>
<div class="line">                tab_test[i].proc();</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        drop_tables();</div>
<div class="line">        con.<a class="code" href="classocilib_1_1_connection.html#a765afaee0c7d73c9dc0690a89db47955">Close</a>();</div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">catch</span> (std::exception &amp;ex)</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; ex.what() &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (con)</div>
<div class="line">    {</div>
<div class="line">        drop_tables();</div>
<div class="line">        con.<a class="code" href="classocilib_1_1_connection.html#a765afaee0c7d73c9dc0690a89db47955">Close</a>();</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_environment.html#a8c21dd437c424a1f6cb63ed66441c979">Environment::Cleanup</a>();</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\nPress any key to exit...&quot;</span>);</div>
<div class="line"></div>
<div class="line">    getchar();</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* Helpers methods</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">bool</span> FillProductFromQuery(<span class="keyword">const</span> <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> &amp;rs, Product &amp;p)</div>
<div class="line">{</div>
<div class="line">    p.code = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">int</span>&gt;(1);</div>
<div class="line">    p.action = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(2);</div>
<div class="line">    p.price = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">double</span>&gt;(3);</div>
<div class="line">    p.date = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_date.html">Date</a>&gt;(4);</div>
<div class="line"></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">Product CreateProductFromQuery(<span class="keyword">const</span> <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> &amp;rs)</div>
<div class="line">{</div>
<div class="line">    Product p;</div>
<div class="line"></div>
<div class="line">    rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>(1, p.code);</div>
<div class="line">    rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>(2, p.action);</div>
<div class="line">    rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>(3, p.price);</div>
<div class="line">    rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>(4, p.date);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span> p;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">bool</span> PrintProductFromQuery(<span class="keyword">const</span> <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> &amp;rs)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;&gt; code   : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">int</span>&gt;(1);</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;, action : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(2);</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;, price  : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">double</span>&gt;(3);</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;, date   : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_date.html">Date</a>&gt;(4);</div>
<div class="line">    ocout &lt;&lt; oendl;</div>
<div class="line">    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">bool</span> PrintProductFromObject(<span class="keyword">const</span> Product &amp;p)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;&gt; code   : &quot;</span>) &lt;&lt; p.code;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;, action : &quot;</span>) &lt;&lt; p.action;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;, price  : &quot;</span>) &lt;&lt; p.price;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;, date   : &quot;</span>) &lt;&lt; p.date;</div>
<div class="line">    ocout &lt;&lt; oendl;</div>
<div class="line">    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* print_version</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> print_version(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; OCILIB BUILD INFORMATION \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code" href="classocilib_1_1_environment.html#aadbc0d6b12969d64e46a11aa43ac4ba0">Environment::GetImportMode</a>() == <a class="code" href="classocilib_1_1_environment.html#a1df21a89df5dd3dbd9cfa70f490cee50aa6ad18a3738f1d104e6828d4d508f07e">Environment::ImportLinkage</a>)</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;OCI import mode         : LINKAGE\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;OCI import mode         : RUNTIME\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code" href="classocilib_1_1_environment.html#aab574a36efa9fd91350dd0f193cab08c">Environment::GetCharset</a>() == <a class="code" href="classocilib_1_1_environment.html#a0c5a4f467a27a13663e4c8db58674762a39ca35557be66034e12b2ae3819f146f">Environment::CharsetAnsi</a>)</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;Charset type            : ANSI\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;Charset type            : WIDE\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; VERSIONS INFORMATION \n\n&quot;</span>);</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;OCILIB major    version : &quot;</span>) &lt;&lt; OCILIB_MAJOR_VERSION &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;OCILIB minor    version : &quot;</span>) &lt;&lt; OCILIB_MINOR_VERSION &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;OCILIB revision version : &quot;</span>) &lt;&lt; OCILIB_REVISION_VERSION &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;OCI compile     version : &quot;</span>) &lt;&lt; <a class="code" href="classocilib_1_1_environment.html#ab960dffe3b86e8748d5b518c64e52db2">Environment::GetCompileMajorVersion</a>() &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;OCI runtime     version : &quot;</span>) &lt;&lt; <a class="code" href="classocilib_1_1_environment.html#a11ddff7767cf09a87ce317c0f114542c">Environment::GetRuntimeMajorVersion</a>() &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Server major    version : &quot;</span>) &lt;&lt; con.<a class="code" href="classocilib_1_1_connection.html#a41ebe16ee04ad901747a9fa090dc251b">GetServerMajorVersion</a>() &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Server minor    version : &quot;</span>) &lt;&lt; con.<a class="code" href="classocilib_1_1_connection.html#a7ba2c35950bb8a3416150190079038fe">GetServerMinorVersion</a>() &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Server revision version : &quot;</span>) &lt;&lt; con.<a class="code" href="classocilib_1_1_connection.html#a6c6217b406bf764707cb9e179400128a">GetServerRevisionVersion</a>() &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Connection      version : &quot;</span>) &lt;&lt; <span class="keyword">static_cast&lt;</span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span><span class="keyword">&gt;</span>(con.<a class="code" href="classocilib_1_1_connection.html#a6c421913ed279d8fc0c1bbfcfe22f972">GetVersion</a>()) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; SERVER VERSION BANNER \n\n&quot;</span>);</div>
<div class="line">    ocout &lt;&lt; con.<a class="code" href="classocilib_1_1_connection.html#a677c2d678d56f2d10ae3b78ab5c087c8">GetServerVersion</a>() &lt;&lt; oendl &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* execute_ddl</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> execute_ddl(<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> sql)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">try</span></div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">        st.Execute(sql);</div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">catch</span> (<a class="code" href="classocilib_1_1_exception.html">Exception</a> &amp;ex)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">switch</span> (ex.<a class="code" href="classocilib_1_1_exception.html#a33972f176e066ac07a728d8920d4774e">GetType</a>().GetValue())</div>
<div class="line">        {</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="classocilib_1_1_exception.html#a1c4917298b7dee8f7b0bcd5279bffb8ca333285a9580d1637d8398204c282cbcc">Exception::OracleError</a>:</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;Oracle Error =&gt; &quot;</span>);</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="classocilib_1_1_exception.html#a1c4917298b7dee8f7b0bcd5279bffb8caaab61cccf5ae513931572515748156ad">Exception::OracleWarning</a>:</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;Oracle Error =&gt; &quot;</span>);</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="classocilib_1_1_exception.html#a1c4917298b7dee8f7b0bcd5279bffb8ca7aa90bd6ce524a4a84ceb8a1e2dc9832">Exception::OcilibError</a>:</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;OCILIB Error =&gt; &quot;</span>);</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">default</span>:</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;Unknown Error =&gt; &quot;</span>);</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; ex.<a class="code" href="classocilib_1_1_exception.html#af890462b7d593b7166d8ecff2e3b111f">what</a>() &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* create_tables</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> create_tables(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; CREATE TABLES FOR DEMO \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create types for the demo */</span></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create type type_t as OBJECT (id int, name varchar2(50))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create type test_t as object &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_int  number, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_flt  float, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_dbl  float, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_str  varchar2(30), &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_date date, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_lob  clob, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_file bfile, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_obj  type_t, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_raw  raw(10) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create type t_tab1_emp as VARRAY(100) of varchar2(50)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create type t_tab2_emp as table of varchar2(50)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create table for the demo */</span></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_fetch(code int, article &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;varchar2(30), price float, creation date)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_long_raw(code int, content long raw)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_long_str(code int, content long)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_lob(code int, content clob)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_object(val test_t)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_table_obj of type_t&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_array &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_int  number, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_dbl  float, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_flt  float, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_str  varchar2(30), &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_date date, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_lob  clob, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    val_file bfile &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;)&quot;</span>)</div>
<div class="line">        );</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_coll_varray &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    departement number, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    employees   t_tab1_emp &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;)&quot;</span>)</div>
<div class="line">        );</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_coll_nested &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    departement number, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    employees   t_tab2_emp &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;) nested table employees store as test_table_emp&quot;</span>)</div>
<div class="line">        );</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;create table test_directpath(val_int number(8,4), &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot; val_str varchar2(30), val_date date)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* insert data into the demo tables */</span></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_fetch &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;(code, article, price, creation) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values (1, &#39;shoes&#39;, 3.14, to_date(&#39;1978-12-23&#39;, &#39;YYYY-MM-DD&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_fetch &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;(code, article, price, creation) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values (2, &#39;shirt&#39;, 5.99, to_date(&#39;1999-09-12&#39;, &#39;YYYY-MM-DD&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_lob(code,content)  &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values (1, EMPTY_CLOB())&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_long_str(code,content) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values (1, &#39;Rugby rocks !&#39;)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_coll_varray(departement,employees) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values (1, t_tab1_emp(&#39;Peter&#39;, &#39;John&#39;, &#39;Paula&#39;, &#39;Gina&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_coll_varray(departement,employees) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values (2, t_tab1_emp(&#39;Ben&#39;, &#39;Alice&#39;, &#39;Joel&#39;, &#39;Maria&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_coll_nested(departement,employees) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values (1, t_tab2_emp(&#39;Vince&#39;, &#39;Richard&#39;, &#39;Rita&#39;, &#39;Sophia&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_coll_nested(departement,employees) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values (2, t_tab2_emp(&#39;Paul&#39;, &#39;Sarah&#39;, &#39;Robert&#39;, &#39;Zoe&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_table_obj values(type_t(1, &#39;shoes&#39;))&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;insert into test_table_obj values(type_t(2, &#39;pen&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    con.<a class="code" href="classocilib_1_1_connection.html#a5875666074d5c8b9cfb1f5660f176757">Commit</a>();</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* drop_tables</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> drop_tables(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; DROPPING TABLES AND TYPES \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_fetch&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_long_str&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_long_raw&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_lob&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_array&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_object&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_coll_varray&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_coll_nested&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_table_obj&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop table test_directpath&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop type  test_t&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop type  type_t&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop type  t_tab1_emp&quot;</span>));</div>
<div class="line">    execute_ddl(otext(<span class="stringliteral">&quot;drop type  t_tab2_emp&quot;</span>));</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_fetch</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_fetch(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; SIMPLE TEST FETCH WITH META DATA\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select * from test_fetch&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1, n = rs.<a class="code" href="classocilib_1_1_resultset.html#adf46e0b94a5c1272e63c6e25c211aad0">GetColumnCount</a>(); i &lt;= n; i++)</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;&gt; Field : #&quot;</span>) &lt;&lt; i &lt;&lt; otext(<span class="stringliteral">&quot; - Name : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#af7585acb43fc8d54ae025fe1d5c9d7d1">GetColumn</a>(i).GetName() &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        PrintProductFromQuery(rs);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) fetched&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_fetch_translate</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_fetch_translate(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; SIMPLE TEST FETCH  WITH ROW TRANSLATION TO USER TYPE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select * from test_fetch&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        Product p;</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span> (rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>(p, FillProductFromQuery))</div>
<div class="line">        {</div>
<div class="line">            PrintProductFromObject(p);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) fetched&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_foreach</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_foreach(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; FOREACH FETCH\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select * from test_fetch&quot;</span>), PrintProductFromQuery);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_foreach_translate</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_foreach_translate(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; FOREACH FETCH WITH TRANSLATION\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select * from test_fetch&quot;</span>), PrintProductFromObject, CreateProductFromQuery);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_bind1</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_bind1(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> code = 1, count = 0;</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;select * from test_fetch where code = :code&quot;</span>));</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:code&quot;</span>), code, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    count = st.ExecutePrepared(PrintProductFromObject, CreateProductFromQuery);</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; count &lt;&lt; otext(<span class="stringliteral">&quot; row(s) fetched&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_bind2</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_bind2(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; SINGLE BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;insert into test_array &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   val_int,  val_dbl, val_flt, val_str, val_date, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   val_lob, val_file &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   :val_int, :val_dbl, :val_flt, :val_str, :val_date, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   :val_lob, :val_file &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;) &quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create objects and set values */</span></div>
<div class="line"></div>
<div class="line">    TestArray t;</div>
<div class="line"></div>
<div class="line">    t.val_date = <a class="code" href="classocilib_1_1_date.html#a5d7ee0191341605450e52102ad6a92f7">Date::SysDate</a>();</div>
<div class="line">    t.val_int  = 1;</div>
<div class="line">    t.val_dbl  = 3.14;</div>
<div class="line">    t.val_flt  = 3.14f;</div>
<div class="line">    t.val_str  = otext(<span class="stringliteral">&quot;Name00&quot;</span>);</div>
<div class="line">    t.val_lob  = <a class="code" href="namespaceocilib.html#a5dea067365397df11f7bf57baaba2f18">Clob</a>(con);</div>
<div class="line">    t.val_file = <a class="code" href="classocilib_1_1_file.html">File</a>(con);</div>
<div class="line"></div>
<div class="line">    t.val_lob.Write(otext(<span class="stringliteral">&quot;lob value00&quot;</span>));</div>
<div class="line">    t.val_file.SetInfos(otext(<span class="stringliteral">&quot;mydir&quot;</span>), otext(<span class="stringliteral">&quot;file00.txt&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* bind scalar C types arrays */</span></div>
<div class="line"></div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_int&quot;</span>), t.val_int, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_dbl&quot;</span>), t.val_dbl, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_flt&quot;</span>), t.val_flt, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_str&quot;</span>), t.val_str, static_cast&lt;unsigned int&gt;(t.val_str.size()), <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* bind oracle types arrays */</span></div>
<div class="line"></div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_date&quot;</span>), t.val_date, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_lob&quot;</span>), t.val_lob, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_file&quot;</span>), t.val_file, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* do insert */</span></div>
<div class="line"></div>
<div class="line">    st.ExecutePrepared();</div>
<div class="line">    con.<a class="code" href="classocilib_1_1_connection.html#a5875666074d5c8b9cfb1f5660f176757">Commit</a>();</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; st.GetAffectedRows() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) inserted&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_piecewise_insert</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_piecewise_insert(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST PIECEWISE INSERTING\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    std::ifstream file(OCI_SHARED_LIB, std::ios::in | std::ios::binary | std::ios::ate);</div>
<div class="line">    <span class="keywordflow">if</span> (file.is_open())</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordtype">size_t</span> size = <span class="keyword">static_cast&lt;</span><span class="keywordtype">size_t</span><span class="keyword">&gt;</span>(file.tellg());</div>
<div class="line">        file.seekg(0, std::ios::beg);</div>
<div class="line">        ocout &lt;&lt; oendl &lt;&lt; size &lt;&lt; otext(<span class="stringliteral">&quot; bytes to write&quot;</span>) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">        Blong lg(st);</div>
<div class="line">        st.Prepare(otext(<span class="stringliteral">&quot;insert into test_long_raw(code, content) values (1, :data)&quot;</span>));</div>
<div class="line">        st.SetLongMaxSize(static_cast&lt;unsigned int&gt;(size));</div>
<div class="line">        st.Bind(otext(<span class="stringliteral">&quot;:data&quot;</span>), lg, static_cast&lt;unsigned int&gt;(size), <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">        st.ExecutePrepared();</div>
<div class="line"></div>
<div class="line">        <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *strBuffer = <span class="keyword">new</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>[size];</div>
<div class="line">        file.read(reinterpret_cast&lt;char *&gt;(strBuffer), size);</div>
<div class="line">        lg.Write(<a class="code" href="namespaceocilib.html#a7a8f606db0b3fbbf7d814240c5f96178">Raw</a>(strBuffer, strBuffer + size));</div>
<div class="line"></div>
<div class="line">        <span class="keyword">delete</span>[] strBuffer;</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; oendl &lt;&lt; lg.GetLength() &lt;&lt; otext(<span class="stringliteral">&quot; bytes written&quot;</span>) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        file.close();</div>
<div class="line">        con.<a class="code" href="classocilib_1_1_connection.html#a5875666074d5c8b9cfb1f5660f176757">Commit</a>();</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_piecewise_fetch</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_piecewise_fetch(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST PIECEWISE FETCHING\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select content from test_long_raw where code = 1&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs1 = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs1++)</div>
<div class="line">    {</div>
<div class="line">        Blong lg = rs1.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;Blong&gt;(1);</div>
<div class="line">        ocout &lt;&lt; oendl &lt;&lt; lg.<a class="code" href="classocilib_1_1_long.html#a0e53bfd674f41a290c3130aa4db27331">GetLength</a>() &lt;&lt; otext(<span class="stringliteral">&quot; bytes read&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; rs1.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) fetched&quot;</span>) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST LONG MAPPED TO STRING\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select content from test_long_str where code = 1&quot;</span>));</div>
<div class="line">    st.SetLongMode(<a class="code" href="classocilib_1_1_statement.html#a095c882ba807ccba7bf693b5652385e1a0da780a1752bfcd8a6458ddbd4f7511b">Statement::LongImplicit</a>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs2 = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs2++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> str = rs2.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(1);</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; str &lt;&lt; oendl;</div>
<div class="line">        ocout &lt;&lt; str.size() &lt;&lt; otext(<span class="stringliteral">&quot; bytes read&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; rs2.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) fetched&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_lob</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_lob(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST LOB MANIPULATION\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select code, content from test_lob where code=1 for update&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_lob.html">Clob</a> clob = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_lob.html">Clob</a>&gt;(2);</div>
<div class="line"></div>
<div class="line">        clob.<a class="code" href="classocilib_1_1_lob.html#aadf90a428f4e25b011d991d8f355c9ef">Write</a>(otext(<span class="stringliteral">&quot;today, &quot;</span>));</div>
<div class="line">        clob.<a class="code" href="classocilib_1_1_lob.html#a3aef22c31a20e7b5dc44c536a3fd69f6">Append</a>(otext(<span class="stringliteral">&quot;i&#39;m going to the cinema ! &quot;</span>));</div>
<div class="line">        clob.<a class="code" href="classocilib_1_1_lob.html#aa2de24600dc407f812718d62671a0ac3">Seek</a>(<a class="code" href="namespaceocilib.html#a4f93943c01043379927c2944b0c92576a6cb13438b0bad43b2d4b112c6017ce81">SeekSet</a>, 0);</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;&gt; code : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">int</span>&gt;(1) &lt;&lt; otext(<span class="stringliteral">&quot;, content : &quot;</span>) &lt;&lt; clob.<a class="code" href="classocilib_1_1_lob.html#a9f7e0255662d7bdd9d60fb98a6b8d455">Read</a>(SizeString) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    con.<a class="code" href="classocilib_1_1_connection.html#a5875666074d5c8b9cfb1f5660f176757">Commit</a>();</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) fetched&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_nested_table</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_nested_table(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST NESTED TABLE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select article, cursor(select sysdate from dual) from test_fetch&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_statement.html">Statement</a> st2 = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_statement.html">Statement</a>&gt;(2);</div>
<div class="line">        <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs2 = st2.<a class="code" href="classocilib_1_1_statement.html#a7fc464c5b2aa171ada650e04b26555f6">GetResultset</a>();</div>
<div class="line">        <span class="keywordflow">while</span> (rs2++)</div>
<div class="line">        {</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;Article : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(1) &lt;&lt; otext(<span class="stringliteral">&quot;, Date : &quot;</span>) &lt;&lt; rs2.Get&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(1) &lt;&lt; oendl;</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_ref_cursor</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_ref_cursor(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST REF CURSOR  \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> stBind(con);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;begin open :c for select * from test_fetch; end;&quot;</span>));</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:c&quot;</span>), stBind, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a67779a9cdb0260b28a91337466ff0aaa">BindInfo::Out</a>);</div>
<div class="line">    st.ExecutePrepared();</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = stBind.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        PrintProductFromQuery(rs);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) fetched&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_plsql</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_plsql(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST PL/SQL OUTPUT BIND\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">int</span> res = 0;</div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line"></div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;begin :res := trunc(sysdate+1)-trunc(sysdate-1); end;&quot;</span>));</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:res&quot;</span>), res, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a67779a9cdb0260b28a91337466ff0aaa">BindInfo::Out</a>);</div>
<div class="line">    st.ExecutePrepared();</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;PL/SQL : trunc(sysdate+1)-trunc(sysdate-1)&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Result : &quot;</span>) &lt;&lt; res &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#ifndef OCI_CHARSET_ANSI</span></div>
<div class="line">    <span class="comment">/* Oracle 8i has some troubles with SERVER OUTPUT in unicode */</span></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code" href="classocilib_1_1_environment.html#a6e6872be754719ec2b36819a01161494">Environment::GetRuntimeVersion</a>() &lt; Oracle9iR1)</div>
<div class="line">        <span class="keywordflow">return</span>;</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST PL/SQL SERVER OUTPUT\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* server output */</span></div>
<div class="line"></div>
<div class="line">    con.<a class="code" href="classocilib_1_1_connection.html#a43eb6879fc41ddc0dc790ed0793e2c47">EnableServerOutput</a>(32000, 5, 255);</div>
<div class="line"></div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;begin &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   dbms_output.put_line(&#39;First  line&#39;); &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   dbms_output.put_line(&#39;Second line&#39;); &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   dbms_output.put_line(&#39;Third  line&#39;); &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;end;&quot;</span>)</div>
<div class="line">        );</div>
<div class="line"></div>
<div class="line">    <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> line;</div>
<div class="line">    <span class="keywordflow">while</span> (con.<a class="code" href="classocilib_1_1_connection.html#aa20212250b93efe1064cbc183e1e4c27">GetServerOutput</a>(line))</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; line &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    con.<a class="code" href="classocilib_1_1_connection.html#a5dbac14acd330f73defd8bc9c8ea6a63">DisableServerOutput</a>();</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_dates</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_dates(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST DATETIME MANIPULATION\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_date.html">Date</a> date(otext(<span class="stringliteral">&quot;1978-04-13&quot;</span>));</div>
<div class="line">    ocout &lt;&lt; date &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; date.SysDate() &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    date.AddDays(5);</div>
<div class="line">    date.AddMonths(2);</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Date + 5 days and 2 months is &quot;</span>) &lt;&lt; date &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Last day of the month : &quot;</span>) &lt;&lt; date.LastDay() &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Number of days until the end of the months : &quot;</span>) &lt;&lt; date.LastDay().DaysBetween(date) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_timestamp</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_timestamp(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version = <a class="code" href="classocilib_1_1_environment.html#a6e6872be754719ec2b36819a01161494">Environment::GetRuntimeVersion</a>();</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#ifndef OCI_CHARSET_ANSI</span></div>
<div class="line">    <span class="comment">/* Oracle 9i has some troubles with formatting Intervals/timestamps in</span></div>
<div class="line"><span class="comment">    an UTF16 context... */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> ((version &gt;= Oracle9iR1) || (version &lt; Oracle10gR1))</div>
<div class="line">        <span class="keywordflow">return</span>;</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (version &gt;= Oracle9iR1)</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST TIMESTAMP\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_timestamp.html">Timestamp</a> tm = <a class="code" href="classocilib_1_1_timestamp.html#ab4e620bbb5f5843447254da1505dfbc1">Timestamp::SysTimestamp</a>();</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;Current timestamp: &quot;</span>) &lt;&lt; tm &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* intervals raw oci functions have some troubles with Oracle 9i. So let&#39;s</span></div>
<div class="line"><span class="comment">        use it for the demo only if we&#39;re using 10g or above */</span></div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span> (version &gt;= Oracle10gR1)</div>
<div class="line">        {</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST INTERVAL \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            <a class="code" href="classocilib_1_1_interval.html">Interval</a> itv(<a class="code" href="classocilib_1_1_interval.html#ade63841c62db260d50ce4190719c062bacc9b789f9ef86cf26bc87f312ecfa31b">Interval::DaySecond</a>);</div>
<div class="line">            itv.SetDaySecond(1, 1, 1, 1, 0);</div>
<div class="line">            tm += itv;</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;Current timestamp + Interval: &quot;</span>) &lt;&lt; tm &lt;&lt; oendl;</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_describe</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_describe(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST DESCRIBING TABLE \n\n&quot;</span>);</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Column Name         Type                &quot;</span>) &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;----------------------------------------&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; std::setiosflags(std::ios::left);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_type_info.html">TypeInfo</a> table(con, otext(<span class="stringliteral">&quot;test_fetch&quot;</span>), <a class="code" href="classocilib_1_1_type_info.html#a7369d09e8bd979f61371c80c46ee894eaaf98069bddb83ee08f0de7562e66851f">TypeInfo::Table</a>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1, n = table.GetColumnCount(); i &lt;= n; i++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_column.html">Column</a> col = table.GetColumn(i);</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; std::setw(20) &lt;&lt; col.GetName().c_str()</div>
<div class="line">            &lt;&lt; std::setw(20) &lt;&lt; col.<a class="code" href="classocilib_1_1_column.html#ad1f81717be4c24122c5e81db7da03950">GetFullSQLType</a>().c_str()</div>
<div class="line">            &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* TEST DESCRIBING TYPE ------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST DESCRIBING TYPE \n\n&quot;</span>);</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Column Name         Type                &quot;</span>) &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;----------------------------------------&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">    ocout &lt;&lt; std::setiosflags(std::ios::left);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_type_info.html">TypeInfo</a> type(con, otext(<span class="stringliteral">&quot;test_t&quot;</span>), <a class="code" href="classocilib_1_1_type_info.html#a7369d09e8bd979f61371c80c46ee894eaa7acfaf3f68a4866b13bd14b7e7611ca">TypeInfo::Type</a>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1, n = type.GetColumnCount(); i &lt;= n; i++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_column.html">Column</a> col = type.GetColumn(i);</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; std::setw(20) &lt;&lt; col.GetName().c_str()</div>
<div class="line">            &lt;&lt; std::setw(20) &lt;&lt; col.<a class="code" href="classocilib_1_1_column.html#ad1f81717be4c24122c5e81db7da03950">GetFullSQLType</a>().c_str()</div>
<div class="line">            &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_returning</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_returning(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST RETURNING CLAUSE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;update test_lob set code = code + 1 returning code, content into :i, :l&quot;</span>));</div>
<div class="line">    st.Register&lt;<span class="keywordtype">int</span>&gt;(otext(<span class="stringliteral">&quot;:i&quot;</span>));</div>
<div class="line">    st.Register&lt;<a class="code" href="classocilib_1_1_lob.html">Clob</a>&gt;(otext(<span class="stringliteral">&quot;:l&quot;</span>));</div>
<div class="line">    st.ExecutePrepared();</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_lob.html">Clob</a> clob = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_lob.html">Clob</a>&gt;(2);</div>
<div class="line">        clob.<a class="code" href="classocilib_1_1_lob.html#a3aef22c31a20e7b5dc44c536a3fd69f6">Append</a>(otext(<span class="stringliteral">&quot;(modified)&quot;</span>));</div>
<div class="line">        clob.<a class="code" href="classocilib_1_1_lob.html#aa2de24600dc407f812718d62671a0ac3">Seek</a>(<a class="code" href="namespaceocilib.html#a4f93943c01043379927c2944b0c92576a6cb13438b0bad43b2d4b112c6017ce81">SeekSet</a>, 0);</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;&gt; code : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">int</span>&gt;(1) &lt;&lt; otext(<span class="stringliteral">&quot; - &quot;</span>) &lt;&lt; clob.<a class="code" href="classocilib_1_1_lob.html#a9f7e0255662d7bdd9d60fb98a6b8d455">Read</a>(static_cast&lt;unsigned int&gt;(clob.<a class="code" href="classocilib_1_1_lob.html#ae5c38ace48474aae5e8a0bef6bc8161d">GetLength</a>())) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    con.<a class="code" href="classocilib_1_1_connection.html#a5875666074d5c8b9cfb1f5660f176757">Commit</a>();</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) fetched&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_returning_array</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_returning_array(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST ARRAY BINDING WITH RETURNING CLAUSE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    std::vector&lt;int&gt;     tab_int;</div>
<div class="line">    std::vector&lt;double&gt;  tab_dbl;</div>
<div class="line">    std::vector&lt;float&gt;   tab_flt;</div>
<div class="line">    std::vector&lt;ostring&gt; tab_str;</div>
<div class="line">    std::vector&lt;Date&gt;    tab_date;</div>
<div class="line">    std::vector&lt;Clob&gt;    tab_lob;</div>
<div class="line">    std::vector&lt;File&gt;    tab_file;</div>
<div class="line"></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; ElemCount; i++)</div>
<div class="line">    {</div>
<div class="line">        tab_int.push_back(i + 1);</div>
<div class="line">        tab_dbl.push_back(3.14*static_cast&lt;double&gt;(i + 1));</div>
<div class="line">        tab_flt.push_back(3.14f*static_cast&lt;float&gt;(i + 1));</div>
<div class="line"></div>
<div class="line">        <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> str;</div>
<div class="line">        str += otext(<span class="stringliteral">&quot;Name&quot;</span>);</div>
<div class="line">        str += ((i + 1) + <span class="charliteral">&#39;0&#39;</span>);</div>
<div class="line">        tab_str.push_back(str);</div>
<div class="line"></div>
<div class="line">        tab_date.push_back(<a class="code" href="classocilib_1_1_date.html#a5d7ee0191341605450e52102ad6a92f7">Date::SysDate</a>());</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_lob.html">Clob</a> clob(con);</div>
<div class="line">        clob.<a class="code" href="classocilib_1_1_lob.html#aadf90a428f4e25b011d991d8f355c9ef">Write</a>(otext(<span class="stringliteral">&quot;Lob value &quot;</span>) + str);</div>
<div class="line">        tab_lob.push_back(clob);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a> fileName;</div>
<div class="line">        fileName += otext(<span class="stringliteral">&quot;File&quot;</span>);</div>
<div class="line">        fileName += ((i + 1) + <span class="charliteral">&#39;0&#39;</span>);</div>
<div class="line">        <a class="code" href="classocilib_1_1_file.html">File</a> file(con, otext(<span class="stringliteral">&quot;Mydir&quot;</span>), fileName);</div>
<div class="line">        tab_file.push_back(file);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line"></div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;insert into test_array &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   val_int,  val_dbl, val_flt, val_str, val_date, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   val_lob, val_file &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;values &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   :val_int, :val_dbl, :val_flt, :val_str, :val_date, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   :val_lob, :val_file &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;) &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;returning&quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;  val_int,  val_dbl, val_flt, val_str, val_date, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   val_lob, val_file &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;into  &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;  :out_int, :out_dbl, :out_flt,  :out_str, :out_date, &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;   :out_lob, :out_file &quot;</span>));</div>
<div class="line"></div>
<div class="line">    st.SetBindArraySize(ElemCount);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* bind vectors */</span></div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_int&quot;</span>), tab_int, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_dbl&quot;</span>), tab_dbl, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_flt&quot;</span>), tab_flt, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_date&quot;</span>), tab_date, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_lob&quot;</span>), tab_lob, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_file&quot;</span>), tab_file, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:val_str&quot;</span>), tab_str, 30, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* register output */</span></div>
<div class="line">    st.Register&lt;<span class="keywordtype">int</span>    &gt;(otext(<span class="stringliteral">&quot;:out_int&quot;</span>));</div>
<div class="line">    st.Register&lt;<span class="keywordtype">double</span> &gt;(otext(<span class="stringliteral">&quot;:out_dbl&quot;</span>));</div>
<div class="line">    st.Register&lt;<span class="keywordtype">float</span>  &gt;(otext(<span class="stringliteral">&quot;:out_flt&quot;</span>));</div>
<div class="line">    st.Register&lt;<a class="code" href="classocilib_1_1_date.html">Date</a>   &gt;(otext(<span class="stringliteral">&quot;:out_date&quot;</span>));</div>
<div class="line">    st.Register&lt;<a class="code" href="classocilib_1_1_lob.html">Clob</a>   &gt;(otext(<span class="stringliteral">&quot;:out_lob&quot;</span>));</div>
<div class="line">    st.Register&lt;<a class="code" href="classocilib_1_1_file.html">File</a>   &gt;(otext(<span class="stringliteral">&quot;:out_file&quot;</span>));</div>
<div class="line">    st.Register&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(otext(<span class="stringliteral">&quot;:out_str&quot;</span>), 30);</div>
<div class="line"></div>
<div class="line">    st.ExecutePrepared();</div>
<div class="line">    ocout &lt;&lt; oendl &lt;&lt; st.GetAffectedRows() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) inserted&quot;</span>) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">int</span> rowIndex = 0;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (!rs.IsNull())</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">while</span> (rs++)</div>
<div class="line">        {</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;Row #&quot;</span>) &lt;&lt; ++rowIndex &lt;&lt; otext(<span class="stringliteral">&quot;---------------&quot;</span>) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_int    : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">int</span>&gt;(otext(<span class="stringliteral">&quot;:OUT_INT&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_dbl    : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">double</span>&gt;(otext(<span class="stringliteral">&quot;:OUT_DBL&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_flt    : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">float</span>&gt;(otext(<span class="stringliteral">&quot;:OUT_FLT&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_str    : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(otext(<span class="stringliteral">&quot;:OUT_STR&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_date   : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_date.html">Date</a>&gt;(otext(<span class="stringliteral">&quot;:OUT_DATE&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">            <a class="code" href="classocilib_1_1_lob.html">Clob</a> clob = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_lob.html">Clob</a>&gt;(otext(<span class="stringliteral">&quot;:OUT_LOB&quot;</span>));</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_lob    : &quot;</span>) &lt;&lt; clob.<a class="code" href="classocilib_1_1_lob.html#a9f7e0255662d7bdd9d60fb98a6b8d455">Read</a>(SizeBuffer) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">            <a class="code" href="classocilib_1_1_file.html">File</a> file = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_file.html">File</a>&gt;(otext(<span class="stringliteral">&quot;:OUT_FILE&quot;</span>));</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_file   : &quot;</span>) &lt;&lt; file.<a class="code" href="classocilib_1_1_file.html#a194f9b55a4a251bcf9650cc01c366e71">GetDirectory</a>() &lt;&lt; otext(<span class="stringliteral">&quot;/&quot;</span>) &lt;&lt; file.<a class="code" href="classocilib_1_1_file.html#a318995f736ffdeac383cf21b4aeba2d5">GetName</a>() &lt;&lt; oendl;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        rs = st.GetNextResultset();</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_object_insert</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_object_insert(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *constData = <span class="keyword">reinterpret_cast&lt;</span><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*<span class="keyword">&gt;</span>(<span class="keyword">const_cast&lt;</span> <span class="keywordtype">char</span> *<span class="keyword">&gt;</span>(<span class="stringliteral">&quot;0123456789&quot;</span>));</div>
<div class="line">    <a class="code" href="namespaceocilib.html#a7a8f606db0b3fbbf7d814240c5f96178">Raw</a> rawData(constData, constData + 10);</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST OBJECT BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_lob.html">Clob</a> clob(con);</div>
<div class="line">    clob.Write(otext(<span class="stringliteral">&quot;Lob Value&quot;</span>));</div>
<div class="line">    <a class="code" href="classocilib_1_1_file.html">File</a> file(con, otext(<span class="stringliteral">&quot;mydir&quot;</span>), otext(<span class="stringliteral">&quot;myfile&quot;</span>));</div>
<div class="line">    <a class="code" href="classocilib_1_1_date.html">Date</a> date = <a class="code" href="classocilib_1_1_date.html#a5d7ee0191341605450e52102ad6a92f7">Date::SysDate</a>();</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_object.html">Object</a> obj2(<a class="code" href="classocilib_1_1_type_info.html">TypeInfo</a>(con, otext(<span class="stringliteral">&quot;type_t&quot;</span>), <a class="code" href="classocilib_1_1_type_info.html#a7369d09e8bd979f61371c80c46ee894eaa7acfaf3f68a4866b13bd14b7e7611ca">TypeInfo::Type</a>));</div>
<div class="line"></div>
<div class="line">    obj2.Set&lt;<span class="keywordtype">int</span>&gt;(otext(<span class="stringliteral">&quot;ID&quot;</span>), 1);</div>
<div class="line">    obj2.Set&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(otext(<span class="stringliteral">&quot;NAME&quot;</span>), otext(<span class="stringliteral">&quot;USB KEY 2go&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_object.html">Object</a> obj1(<a class="code" href="classocilib_1_1_type_info.html">TypeInfo</a>(con, otext(<span class="stringliteral">&quot;test_t&quot;</span>), <a class="code" href="classocilib_1_1_type_info.html#a7369d09e8bd979f61371c80c46ee894eaa7acfaf3f68a4866b13bd14b7e7611ca">TypeInfo::Type</a>));</div>
<div class="line"></div>
<div class="line">    obj1.Set&lt;<span class="keywordtype">int</span>&gt;(otext(<span class="stringliteral">&quot;VAL_INT&quot;</span>), 1);</div>
<div class="line">    obj1.Set&lt;<span class="keywordtype">double</span>&gt;(otext(<span class="stringliteral">&quot;VAL_DBL&quot;</span>), 3.14);</div>
<div class="line">    obj1.Set&lt;<span class="keywordtype">float</span>&gt;(otext(<span class="stringliteral">&quot;VAL_FLT&quot;</span>), (float) 3.14);</div>
<div class="line">    obj1.Set&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(otext(<span class="stringliteral">&quot;VAL_STR&quot;</span>), otext(<span class="stringliteral">&quot;USB KEY 2go&quot;</span>));</div>
<div class="line">    obj1.Set&lt;<a class="code" href="namespaceocilib.html#a7a8f606db0b3fbbf7d814240c5f96178">Raw</a>&gt;(otext(<span class="stringliteral">&quot;VAL_RAW&quot;</span>), rawData);</div>
<div class="line">    obj1.Set&lt;<a class="code" href="classocilib_1_1_date.html">Date</a>&gt;(otext(<span class="stringliteral">&quot;VAL_DATE&quot;</span>), date);</div>
<div class="line">    obj1.Set&lt;<a class="code" href="classocilib_1_1_object.html">Object</a>&gt;(otext(<span class="stringliteral">&quot;VAL_OBJ&quot;</span>), obj2);</div>
<div class="line">    obj1.<a class="code" href="classocilib_1_1_object.html#a2e81f1294ed13b27d8fe68660342cf57">Set</a>&lt;<a class="code" href="classocilib_1_1_lob.html">Clob</a>&gt;(otext(<span class="stringliteral">&quot;VAL_LOB&quot;</span>), clob);</div>
<div class="line">    obj1.Set&lt;<a class="code" href="classocilib_1_1_file.html">File</a>&gt;(otext(<span class="stringliteral">&quot;VAL_FILE&quot;</span>), file);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;insert into test_object values(:obj)&quot;</span>));</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:obj&quot;</span>), obj1, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.ExecutePrepared();</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Rows inserted :  &quot;</span>) &lt;&lt; st.GetAffectedRows() &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    con.<a class="code" href="classocilib_1_1_connection.html#a5875666074d5c8b9cfb1f5660f176757">Commit</a>();</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_object_fetch</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_object_fetch(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST OBJECT FETCHING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select val from test_object for update&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_object.html">Object</a> obj = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_object.html">Object</a>&gt;(1);</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_int      : &quot;</span>) &lt;&lt; obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<span class="keywordtype">int</span>&gt;(otext(<span class="stringliteral">&quot;VAL_INT&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_dbl      : &quot;</span>) &lt;&lt; obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<span class="keywordtype">double</span>&gt;(otext(<span class="stringliteral">&quot;VAL_DBL&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_flt      : &quot;</span>) &lt;&lt; obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<span class="keywordtype">float</span>&gt;(otext(<span class="stringliteral">&quot;VAL_FLT&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_str      : &quot;</span>) &lt;&lt; obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(otext(<span class="stringliteral">&quot;VAL_STR&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_date     : &quot;</span>) &lt;&lt; obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<a class="code" href="classocilib_1_1_date.html">Date</a>&gt;(otext(<span class="stringliteral">&quot;VAL_DATE&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_lob.html">Clob</a> clob = obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<a class="code" href="classocilib_1_1_lob.html">Clob</a>&gt;(otext(<span class="stringliteral">&quot;VAL_LOB&quot;</span>));</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_lob      : &quot;</span>) &lt;&lt; clob.<a class="code" href="classocilib_1_1_lob.html#a9f7e0255662d7bdd9d60fb98a6b8d455">Read</a>(SizeBuffer) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_file.html">File</a> file = obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<a class="code" href="classocilib_1_1_file.html">File</a>&gt;(otext(<span class="stringliteral">&quot;VAL_FILE&quot;</span>));</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_file     : &quot;</span>) &lt;&lt; file.<a class="code" href="classocilib_1_1_file.html#a194f9b55a4a251bcf9650cc01c366e71">GetDirectory</a>() &lt;&lt; otext(<span class="stringliteral">&quot;/&quot;</span>) &lt;&lt; file.<a class="code" href="classocilib_1_1_file.html#a318995f736ffdeac383cf21b4aeba2d5">GetName</a>() &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        <a class="code" href="namespaceocilib.html#a7a8f606db0b3fbbf7d814240c5f96178">Raw</a> raw = obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<a class="code" href="namespaceocilib.html#a7a8f606db0b3fbbf7d814240c5f96178">Raw</a>&gt;(otext(<span class="stringliteral">&quot;VAL_RAW&quot;</span>));</div>
<div class="line">        raw.push_back(0);</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_raw      : &quot;</span>) &lt;&lt; <span class="keyword">reinterpret_cast&lt;</span><span class="keywordtype">char</span> *<span class="keyword">&gt;</span>(raw.data()) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_object.html">Object</a> obj2 = obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<a class="code" href="classocilib_1_1_object.html">Object</a>&gt;(otext(<span class="stringliteral">&quot;VAL_OBJ&quot;</span>));</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_obj.code : &quot;</span>) &lt;&lt; obj2.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<span class="keywordtype">int</span>&gt;(otext(<span class="stringliteral">&quot;ID&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;.... val_obj.name : &quot;</span>) &lt;&lt; obj2.Get&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(otext(<span class="stringliteral">&quot;NAME&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    con.<a class="code" href="classocilib_1_1_connection.html#a5875666074d5c8b9cfb1f5660f176757">Commit</a>();</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST OBJECT FETCHING  AS STRING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select val from test_object&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_object.html">Object</a>&gt;(1) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_scrollable_cursor</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_scrollable_cursor(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code" href="classocilib_1_1_environment.html#a6e6872be754719ec2b36819a01161494">Environment::GetRuntimeVersion</a>() &gt; Oracle9iR1)</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST SCROLLABLE CURSORS \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line"></div>
<div class="line">        st.SetFetchMode(<a class="code" href="classocilib_1_1_statement.html#a8c77708b4c2fd86c3605544a62bce00ea1c8564c29ec573250bf2bceced410ca6">Statement::FetchScrollable</a>);</div>
<div class="line">        st.Execute(otext(<span class="stringliteral">&quot;select table_name from user_tables where &quot;</span>)</div>
<div class="line">            otext(<span class="stringliteral">&quot;table_name like &#39;TEST_%&#39; order by table_name&quot;</span>));</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line"></div>
<div class="line">        rs.<a class="code" href="classocilib_1_1_resultset.html#a00e41e4767d7435a4c72a38731ab23b9">Last</a>();</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;Total rows : &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;... Go to row 1\n&quot;</span>);</div>
<div class="line">        rs.<a class="code" href="classocilib_1_1_resultset.html#adbcd24336445ed90861bf2f2d13d296b">First</a>();</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;table &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(1) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;... Enumerate from row 2 to row &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() &lt;&lt; otext(<span class="stringliteral">&quot; &quot;</span>) &lt;&lt; oendl;</div>
<div class="line">        <span class="keywordflow">while</span> (rs++)</div>
<div class="line">        {</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;table &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(1) &lt;&lt; oendl;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;... Enumerate from row &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#a704490bcf58c66f5021c626c0fc76b0b">GetCount</a>() - 1 &lt;&lt; otext(<span class="stringliteral">&quot; back to row 1&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">        <span class="keywordflow">while</span> (rs.<a class="code" href="classocilib_1_1_resultset.html#aaa7cb8f998938cce1e5ec33b4aa6015f">Prev</a>())</div>
<div class="line">        {</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;table &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(1) &lt;&lt; oendl;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;... Go to the 3th row&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">        rs.<a class="code" href="classocilib_1_1_resultset.html#a85ea20b0392738677d2dcf36978a5df4">Seek</a>(<a class="code" href="classocilib_1_1_resultset.html#a87e08959fc728718a8d067e198550089a08ad9ce4423b71cb80a06ba3849182f3">Resultset::SeekAbsolute</a>, 3);</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;table &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(1) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;... Fetch the next 2 rows&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">        <span class="keywordflow">while</span> (rs.<a class="code" href="classocilib_1_1_resultset.html#a28a9ed8d9fd5f14ee605336c347fb005">GetCurrentRow</a>() &lt; 5 &amp;&amp; rs++)</div>
<div class="line">        {</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;table &quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(1) &lt;&lt; oendl;</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_collection</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"><span class="keywordtype">void</span> test_collection(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST VARRAY BINDING WITH ITERATOR \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">int</span> i = 1;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line">    <a class="code" href="classocilib_1_1_type_info.html">TypeInfo</a> type(con, otext(<span class="stringliteral">&quot;T_TAB1_EMP&quot;</span>), <a class="code" href="classocilib_1_1_type_info.html#a7369d09e8bd979f61371c80c46ee894eaa7acfaf3f68a4866b13bd14b7e7611ca">TypeInfo::Type</a>);</div>
<div class="line">    <a class="code" href="classocilib_1_1_collection.html">Collection&lt;ostring&gt;</a> coll(type);</div>
<div class="line"></div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;begin&quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    select employees into :tab_emp &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    from test_coll_varray &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;    where departement = :id; &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;end;&quot;</span>));</div>
<div class="line"></div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:tab_emp&quot;</span>), coll, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:id&quot;</span>), i, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a026e00fee6fd4ae470376643180eba05">BindInfo::In</a>);</div>
<div class="line">    st.ExecutePrepared();</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;Department ID #&quot;</span>) &lt;&lt; i &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_collection_1_1_iterator.html">Collection&lt;ostring&gt;::iterator</a> it1 = coll.begin();</div>
<div class="line">    <a class="code" href="classocilib_1_1_collection_1_1_iterator.html">Collection&lt;ostring&gt;::iterator</a> it2 = coll.end();</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span> (; it1 != it2; ++it1)</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;... Employee : &quot;</span>) &lt;&lt; <span class="keyword">static_cast&lt;</span><a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a><span class="keyword">&gt;</span>(*it1) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST VARRAY PRINTING \n\n&quot;</span>);</div>
<div class="line">    ocout &lt;&lt; coll &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST VARRAY FETCHING WITH ITERATOR \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;SELECT * from test_coll_varray&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;Department ID #&quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">int</span>&gt;(1) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        coll = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_collection.html">Collection&lt;ostring&gt;</a> &gt;(2);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_collection_1_1_iterator.html">Collection&lt;ostring&gt;::iterator</a> it1 = coll.begin();</div>
<div class="line">        <a class="code" href="classocilib_1_1_collection_1_1_iterator.html">Collection&lt;ostring&gt;::iterator</a> it2 = coll.end();</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">for</span> (; it1 != it2; ++it1)</div>
<div class="line">        {</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;... Employee : &quot;</span>) &lt;&lt; <span class="keyword">static_cast&lt;</span><a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a><span class="keyword">&gt;</span>(*it1) &lt;&lt; oendl;</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST NESTED TABLE FETCHING WITH INDEX ACCESS \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;SELECT * from test_coll_nested&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;Department ID #&quot;</span>) &lt;&lt; rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<span class="keywordtype">int</span>&gt;(1) &lt;&lt; oendl;</div>
<div class="line"></div>
<div class="line">        coll = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_collection.html">Collection&lt;ostring&gt;</a> &gt;(2);</div>
<div class="line">        <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = 1, n = coll.GetSize(); index &lt;= n; index++)</div>
<div class="line">        {</div>
<div class="line">            ocout &lt;&lt; otext(<span class="stringliteral">&quot;... Employee : &quot;</span>) &lt;&lt; <span class="keyword">static_cast&lt;</span><a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a><span class="keyword">&gt;</span>(coll[index]) &lt;&lt; oendl;</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_ref</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"><span class="keywordtype">void</span> test_ref(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST REF FETCHING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_statement.html">Statement</a> st(con);</div>
<div class="line"></div>
<div class="line">    st.Execute(otext(<span class="stringliteral">&quot;select ref(e) from test_table_obj e&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_resultset.html">Resultset</a> rs = st.GetResultset();</div>
<div class="line">    <span class="keywordflow">while</span> (rs++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="classocilib_1_1_reference.html">Reference</a> ref = rs.<a class="code" href="classocilib_1_1_resultset.html#aeaea5cd57d9b6838f3887ed57338acb8">Get</a>&lt;<a class="code" href="classocilib_1_1_reference.html">Reference</a>&gt;(1);</div>
<div class="line">        <a class="code" href="classocilib_1_1_object.html">Object</a>   obj = ref.<a class="code" href="classocilib_1_1_reference.html#ac5e74284762a782c32b8f5c23688e03e">GetObject</a>();</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<span class="keywordtype">int</span>&gt;(otext(<span class="stringliteral">&quot;ID&quot;</span>)) &lt;&lt; otext(<span class="stringliteral">&quot; - &quot;</span>) &lt;&lt; obj.Get&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(otext(<span class="stringliteral">&quot;NAME&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST REF PL/SQL BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_reference.html">Reference</a> ref(<a class="code" href="classocilib_1_1_type_info.html">TypeInfo</a>(con, otext(<span class="stringliteral">&quot;type_t&quot;</span>), <a class="code" href="classocilib_1_1_type_info.html#a7369d09e8bd979f61371c80c46ee894eaa7acfaf3f68a4866b13bd14b7e7611ca">TypeInfo::Type</a>));</div>
<div class="line"></div>
<div class="line">    st.Prepare(otext(<span class="stringliteral">&quot;begin &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;  select ref(e) into :r from test_table_obj e where e.id = 1; &quot;</span>)</div>
<div class="line">        otext(<span class="stringliteral">&quot;end; &quot;</span>));</div>
<div class="line"></div>
<div class="line">    st.Bind(otext(<span class="stringliteral">&quot;:r&quot;</span>), ref, <a class="code" href="classocilib_1_1_bind_info.html#a08f96498d216e0ad14ab8e7a35406533a401b5f2ceea3399cf4846b8383b2584e">BindInfo::InOut</a>);</div>
<div class="line">    st.ExecutePrepared();</div>
<div class="line"></div>
<div class="line">    <a class="code" href="classocilib_1_1_object.html">Object</a> obj = ref.<a class="code" href="classocilib_1_1_reference.html#ac5e74284762a782c32b8f5c23688e03e">GetObject</a>();</div>
<div class="line">    ocout &lt;&lt; obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<span class="keywordtype">int</span>&gt;(otext(<span class="stringliteral">&quot;ID&quot;</span>)) &lt;&lt; otext(<span class="stringliteral">&quot; - &quot;</span>) &lt;&lt; obj.<a class="code" href="classocilib_1_1_object.html#a7212cec642dc5ce7c9419b3925266e9f">Get</a>&lt;<a class="code" href="namespaceocilib.html#a01daa07e307e429b66fb80f442362237">ostring</a>&gt;(otext(<span class="stringliteral">&quot;NAME&quot;</span>)) &lt;&lt; oendl;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment">* test_directpath</span></div>
<div class="line"><span class="comment">* --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_directpath(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">/* Some OCI Direct path function fails (segfault) if the OCI version of the</span></div>
<div class="line"><span class="comment">    client is different than the server one.</span></div>
<div class="line"><span class="comment">    It happens with OCI 8i and 9i client. Apparently Oracle 10g and 11g seems to</span></div>
<div class="line"><span class="comment">    have fixed these problems.</span></div>
<div class="line"><span class="comment">    Anyway, we run this test case only if the major versions of client and server</span></div>
<div class="line"><span class="comment">    match</span></div>
<div class="line"><span class="comment">    */</span></div>
<div class="line">    <span class="comment">// if (Environment::GetRuntimeMajorVersion() == con.GetServerMajorVersion())</span></div>
<div class="line">    {</div>
<div class="line">        <span class="comment">/* commit any previous pending modifications */</span></div>
<div class="line"></div>
<div class="line">        con.<a class="code" href="classocilib_1_1_connection.html#a5875666074d5c8b9cfb1f5660f176757">Commit</a>();</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; otext(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST DIRECT PATH (10 loads of 100 rows) \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        <span class="keywordtype">int</span> i = 0, j = 0, n = DirPathLoadSize;</div>
<div class="line"></div>
<div class="line">        <a class="code" href="classocilib_1_1_direct_path.html">DirectPath</a> dp(<a class="code" href="classocilib_1_1_type_info.html">TypeInfo</a>(con, otext(<span class="stringliteral">&quot;test_directpath&quot;</span>), <a class="code" href="classocilib_1_1_type_info.html#a7369d09e8bd979f61371c80c46ee894eaaf98069bddb83ee08f0de7562e66851f">TypeInfo::Table</a>), DirPathColumnCount, n);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* optional attributes to set */</span></div>
<div class="line"></div>
<div class="line">        dp.SetBufferSize(DirPathBufferSize);</div>
<div class="line">        dp.SetNoLog(<span class="keyword">true</span>);</div>
<div class="line">        dp.SetParallel(<span class="keyword">true</span>);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* describe the target table */</span></div>
<div class="line"></div>
<div class="line">        dp.SetColumn(1, otext(<span class="stringliteral">&quot;VAL_INT&quot;</span>), DirPathSizeColumn1);</div>
<div class="line">        dp.SetColumn(2, otext(<span class="stringliteral">&quot;VAL_STR&quot;</span>), DirPathSizeColumn2);</div>
<div class="line">        dp.SetColumn(3, otext(<span class="stringliteral">&quot;VAL_DATE&quot;</span>), DirPathSizeColumn3, otext(<span class="stringliteral">&quot;YYYYMMDD&quot;</span>));</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* prepare the load */</span></div>
<div class="line"></div>
<div class="line">        dp.Prepare();</div>
<div class="line"></div>
<div class="line">        n = dp.GetMaxRows();</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">for</span> (i = 0; i &lt; DirPathLoadCount; i++)</div>
<div class="line">        {</div>
<div class="line">            dp.Reset();</div>
<div class="line"></div>
<div class="line">            <span class="keywordflow">for</span> (j = 1; j &lt;= n; j++)</div>
<div class="line">            {</div>
<div class="line">                oostringstream val1, val2, val3;</div>
<div class="line"></div>
<div class="line">                <span class="comment">/* fill test values */</span></div>
<div class="line"></div>
<div class="line">                val1 &lt;&lt; std::setfill(otext(<span class="charliteral">&#39;0&#39;</span>)) &lt;&lt; std::setw(4) &lt;&lt; j + (i * DirPathLoadCount);</div>
<div class="line">                val2 &lt;&lt; otext(<span class="stringliteral">&quot;value &quot;</span>) &lt;&lt; std::setfill(otext(<span class="charliteral">&#39;0&#39;</span>)) &lt;&lt; std::setw(5) &lt;&lt; j + (i * DirPathLoadCount);</div>
<div class="line">                val3 &lt;&lt; std::setfill(otext(<span class="charliteral">&#39;0&#39;</span>)) &lt;&lt; std::setw(2) &lt;&lt; (j % 23) + 1 + 2000 &lt;&lt; std::setw(2) &lt;&lt; (j % 11) + 1 &lt;&lt; (j % 23) + 1;</div>
<div class="line"></div>
<div class="line">                dp.SetEntry(j, 1, val1.str());</div>
<div class="line">                dp.SetEntry(j, 2, val2.str());</div>
<div class="line">                dp.SetEntry(j, 3, val3.str());</div>
<div class="line">            }</div>
<div class="line"></div>
<div class="line">            <span class="comment">/* load data to the server */</span></div>
<div class="line">            dp.Convert();</div>
<div class="line">            dp.Load();</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* commits changes */</span></div>
<div class="line"></div>
<div class="line">        dp.Finish();</div>
<div class="line"></div>
<div class="line">        ocout &lt;&lt; std::setw(4) &lt;&lt; dp.GetRowCount() &lt;&lt; otext(<span class="stringliteral">&quot; row(s) loaded&quot;</span>) &lt;&lt; oendl;</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:38 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
